// 全局配置表格汉化
if($.fn.dataTable){
    $.fn.dataTable.defaults.oLanguage = {
        "sProcessing": "处理中...",
        "sLengthMenu": "显示 _MENU_ 项结果",
        "sZeroRecords": "没有匹配结果",
        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
        "sInfoPostFix": "",
        "sSearch": "搜索：",
        "sUrl": "",
        "sEmptyTable": "表中数据为空",
        "sLoadingRecords": "载入中...",
        "sInfoThousands": ",",
        "oPaginate": {
            "sFirst": "首页",
            "sPrevious": "上页",
            "sNext": "下页",
            "sLast": "末页"
        },
        "oAria": {
            "sSortAscending": ": 以升序排列此列",
            "sSortDescending": ": 以降序排列此列"
        }
    };
}
(function (doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function () {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            docEl.style.fontSize = 100 * (clientWidth / 1560) + 'px';
        };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
// 全局事件
$(document).ready(function () {
    $('.somEditInput').bind('input propertychange', function() {
        $(this).siblings(".somEditTextArea").val($(this).val());
    });
    $('.somEditTextArea').bind('input propertychange', function() {
        $(this).siblings(".somEditInput").val($(this).val());
    });
});
var id=1;
// 参考文献后方添加按钮点击事件
function manageAddInput(){
    id++;
    var bindId = "manageRemoveBtn"+id;
    var html ='<div class="floatLeft manageAddInputBox">' +
        '            <input class="manageAddInput" type="text" placeholder="请输入">' +
        '            <div class="manageAddBtn" onclick="manageAddInput()"><img src="img/centerAdd.png" alt=""></div>' +
        '            <img class="manageRemoveBtn" id="manageRemoveBtn'+id+'" onclick="manageRemoveInput('+"'"+bindId+"'"+')" src="img/remove.png" alt="">' +
        '        </div>';
    $(".manageEditAddInputBpx").append(html);
}
// 参考文献后方删除按钮点击事件
function manageRemoveInput(id){
    var elId = "#"+id;
    $(elId).parent().remove();
}